"""
@author: 江同学呀
@file: index_common.py
@date: 2025/1/7 23:42
@desc: 
"""
from espc.utils.enum_utils import EnumBase


class QueryType(EnumBase):
    """
    查询类型
    """
    default = "*"
    more_like_this = "more_like_this"
    """
    更多此类内容
    https://www.elastic.co/guide/en/elasticsearch/reference/7.17/query-dsl-mlt-query.html
    """
    multi_match = "multi_match"
    """
    多重匹配
    https://www.elastic.co/guide/en/elasticsearch/reference/7.17/query-dsl-multi-match-query.html
    """
    query_string = "query_string"
    """
    查询字符串
    https://www.elastic.co/guide/en/elasticsearch/reference/7.17/query-dsl-query-string-query.html
    """
    simple_query_string = "simple_query_string"
    """
    简单查询字符串
    https://www.elastic.co/guide/en/elasticsearch/reference/7.17/query-dsl-simple-query-string-query.html
    """


class ShardAllocation(EnumBase):
    """
    分片分配
    """
    default = "all"
    all = "all"
    """
    all (default) - Allows shard allocation for all shards.
    all （默认） - 允许为所有分片分配分片。
    """
    primaries = "primaries"
    """
    primaries - Allows shard allocation only for primary shards.
    primaryaries - 仅允许为主分片分配分片。
    """
    new_primaries = "new_primaries"
    """
    new_primaries - Allows shard allocation only for newly-created primary shards.
    new_primaries – 仅允许为新创建的主分片分配分片。
    """
    none = "none"
    """
    none - No shard allocation is allowed.
    none - 不允许分片分配。
    """


class ShardRebalancing(EnumBase):
    """
    分片再平衡
    """
    default = "all"
    all = "all"
    """
    all (default) - Allows shard rebalancing for all shards.
    all （默认） - 允许对所有分片进行分片再平衡。
    """
    primaries = "primaries"
    """
    primaries - Allows shard rebalancing only for primary shards.
    primaryaries - 仅允许对主分片进行分片再平衡。
    """
    replicas = "replicas"
    """
    replicas - Allows shard rebalancing only for replica shards.
    replicas - 仅允许对副本分片进行分片再平衡。
    """
    none = "none"
    """
    none - No shard rebalancing is allowed.
    none - 不允许分片重新平衡。
    """
